package my.jwds.p780;

public class ReachingPoints {
    public static void main(String[] args) {
        ReachingPoints obj = new ReachingPoints();
    }



    public boolean reachingPoints(int sx, int sy, int tx, int ty) {
        while(tx > sx && ty>sy && ty != tx){
            if (tx > ty){
                tx = tx % ty;
            }else{
                ty = ty % tx;
            }
        }
        return tx == sx && ty == sy ||
                tx == sx && ty > sy && (ty-sy) % sx == 0 ||
                ty == sy && tx > sx && (tx-sx) % sy == 0;
    }
}